create table zxb_site_member_consume_record
(
id              int unsigned auto_increment
primary key,
mem_name        varchar(64)             default ''    not null comment '会员名',
mem_card_no     varchar(32)             default ''    not null comment '会员卡号',
mobile          varchar(20)             default ''    not null comment '手机号',
order_sn        varchar(32)             default ''    not null comment '订单号',
store_name      varchar(128)            default ''    not null comment '门店名称',
order_at        int(11) unsigned        default 0     not null comment '下单时间',
order_store     varchar(128)            default ''    not null comment '开单门店',
goods_name      varchar(64)             default ''    not null comment '商品名称',
goods_sn_code   varchar(32)             default ''    not null comment '条码信息',
goods_category  varchar(64)             default ''    not null comment '商品类别',
cert_no         varchar(32)             default ''    not null comment '证书号',
goods_price     int                                   null comment '商品标价',
price           int                                   null comment '标价',
order_discount  decimal(10, 2) unsigned default 0.00  not null comment '整单总折扣',
receive_money   int                                   null comment '应收金额',
recovery_money  int                                   null comment '回收金额',
points          int unsigned            default 0     not null comment '积分',
piece_weight    decimal(10, 3)          default 0.000 not null comment '件重',
glod_weight     decimal(10, 3)          default 0.000 not null comment '金重',
sale_price      int                                   null comment '销售单价',
fee             int                                   null comment '工费',
real_money      int                     default 0     not null comment '实收金额',
goods_pricetype varchar(100)            default ''    not null comment '价格类型',
count           int                                   null comment '数量',
tag_price       int unsigned                          null comment '牌价',
material_price  int unsigned            default 0     not null comment '料价',
is_replace      tinyint                 default 0     not null comment '是否已换 1未换 2已换',
create_at       int                                   null comment '创建时间',
remark          varchar(255)                          null comment '备注',
type            int                                   null comment '数据性质（1 系统 2导致）'
)
comment '会员消费记录表' charset = utf8mb4;

INSERT INTO `zhuxiaobao`.`zxb_site_menu_list` (`pid`, `keyIndex`, `name`, `path`, `hidden`, `component`, `always_show`, `title`, `icon`, `no_cache`, `link`, `is_botton`, `is_default`, `props`, `rule_typestr`, `default_rule_typestr`) VALUES (141, '', 'calenderOther', '/calenderOther', 0, 'Layout', 1, '其他系统订单', 'list', 0, 0, 0, 1, '', '9,3,4', '9,1,2,3,4,11,12');
INSERT INTO `zhuxiaobao`.`zxb_site_menu_list` (`pid`, `keyIndex`, `name`, `path`, `hidden`, `component`, `always_show`, `title`, `icon`, `no_cache`, `link`, `is_botton`, `is_default`, `props`, `rule_typestr`, `default_rule_typestr`) VALUES (521, '', 'calenderOtherView', 'calenderOtherView', 0, '/manager/marketing/calenderOther/index', 1, '其他系统订单消费记录', '', 0, 0, 0, 1, '', '9,3,4', '9,1,2,3,4,11,12');
INSERT INTO `zhuxiaobao`.`zxb_site_menu_list` (`pid`, `keyIndex`, `name`, `path`, `hidden`, `component`, `always_show`, `title`, `icon`, `no_cache`, `link`, `is_botton`, `is_default`, `props`, `rule_typestr`, `default_rule_typestr`) VALUES (522, '', '导入', '', 0, '', 1, '', '', 0, 0, 1, 1, '', '9,1,2', '9,1,2,3,4,11,12');
INSERT INTO `zhuxiaobao`.`zxb_site_menu_list` (`pid`, `keyIndex`, `name`, `path`, `hidden`, `component`, `always_show`, `title`, `icon`, `no_cache`, `link`, `is_botton`, `is_default`, `props`, `rule_typestr`, `default_rule_typestr`) VALUES (522, '', '导出', '', 0, '', 1, '', '', 0, 0, 1, 1, '', '9,1,2', '9,1,2,3,4,11,12');

ALTER TABLE zxb_site_member_consume_record ADD INDEX zxb_site_member_consume_record_mobile_index (mobile);
ALTER TABLE zxb_site_member_consume_record ADD INDEX zxb_site_member_consume_record_goods_sn_code_index (goods_sn_code);
ALTER TABLE zxb_site_member_consume_record ADD INDEX zxb_site_member_consume_record_order_sn_index (order_sn);



update `zhuxiaobao`.`zxb_site_menu_list` set `title` = '其他消费记录' where `title` = '其他系统订单';
update `zhuxiaobao`.`zxb_site_menu_list` set `title` = '其他消费记录' where `title` = '其他系统订单消费记录';

alter table `zhuxiaobao`.`zxb_site_member_consume_record` add `cp_id` int unsigned not null default 0 comment '操作人公司id';

ALTER TABLE zxb_site_member_consume_record ADD INDEX zxb_site_member_consume_record_cp_id_index (cp_id);

INSERT INTO `zhuxiaobao`.`zxb_site_menu_list` ( `pid`, `keyIndex`, `name`, `path`, `hidden`, `component`, `always_show`, `title`, `icon`, `no_cache`, `link`, `is_botton`, `is_default`, `props`, `rule_typestr`, `default_rule_typestr`) VALUES (522, '', '批量删除', '', 0, '', 1, '', '', 0, 0, 1, 1, '', '9,1,2', '9,1,2,3,4,11,12');


===========2024/11/29=============
ALTER TABLE `zhuxiaobao`.`zxb_site_oldmaterial_stock` MODIFY stock_status tinyint unsigned default 1 not null comment '1在库，2调拨中，3调拨，4返厂中，5返厂 6上柜 7撤单';
===========2024/11/29=============

===========2024/12/2=============
INSERT INTO `zhuxiaobao`.`zxb_site_menu_list` (`pid`, `keyIndex`, `name`, `path`, `hidden`, `component`, `always_show`, `title`, `icon`, `no_cache`, `link`, `is_botton`, `is_default`, `props`, `rule_typestr`, `default_rule_typestr`) VALUES (522, '', '模板下载', '', 0, '', 1, '', '', 0, 0, 1, 1, '', '9,1,2', '9,1,2,3,4,11,12');

alter table `zhuxiaobao`.`zxb_site_member_consume_record` add `discount_money` int unsigned not null default 0 comment '优惠金额';
alter table `zhuxiaobao`.`zxb_site_member_consume_record` add `cost_price` int unsigned not null default 0 comment '克销工费';
===========2024/12/2=============


//2025-11-20  支持折扣小数
ALTER TABLE `zxb_site_sysset_commission_discount`
MODIFY COLUMN `discount_min`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '折扣区间min' AFTER `goods_category_id`,
MODIFY COLUMN `discount_max`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '折扣区间max' AFTER `discount_min`,
MODIFY COLUMN `commission_rate`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '提成比例' AFTER `discount_max`,
MODIFY COLUMN `commission_rate_1`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '导购提成比例' AFTER `commission_rate`,
MODIFY COLUMN `commission_rate_2`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '副导购提成比例' AFTER `commission_rate_1`;


ALTER TABLE `zxb_site_sysset_commission_preferention`
MODIFY COLUMN `preferential_min`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '优惠区间min' AFTER `goods_category_id`,
MODIFY COLUMN `preferential_max`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '优惠区间max' AFTER `preferential_min`,
MODIFY COLUMN `commission_rate`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '提成比例' AFTER `type`,
MODIFY COLUMN `commission_rate_1`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '导购提成比例' AFTER `commission_rate`,
MODIFY COLUMN `commission_rate_2`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '副导购提成比例' AFTER `commission_rate_1`;

ALTER TABLE `zxb_site_sysset_commission_priceandfee`
MODIFY COLUMN `preferential_min`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '优惠区间min' AFTER `goods_category_id`,
MODIFY COLUMN `preferential_max`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '优惠区间max' AFTER `preferential_min`,
MODIFY COLUMN `commission_rate`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '提成比例' AFTER `type`,
MODIFY COLUMN `commission_rate_1`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '导购提成比例' AFTER `commission_rate`,
MODIFY COLUMN `commission_rate_2`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '副导购提成比例' AFTER `commission_rate_1`;

ALTER TABLE `zxb_site_sysset_commission_recovery`
MODIFY COLUMN `commission_rate`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '提成比例' AFTER `performance`,
MODIFY COLUMN `commission_rate_1`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '导购提成比例' AFTER `commission_rate`,
MODIFY COLUMN `commission_rate_2`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '副导购提成比例' AFTER `commission_rate_1`;

ALTER TABLE `zxb_site_sysset_commission_changegoods`
MODIFY COLUMN `discount_min`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '折扣区间min' AFTER `change_channel`,
MODIFY COLUMN `discount_max`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '折扣区间max' AFTER `discount_min`,
MODIFY COLUMN `commission_rate`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '提成比例' AFTER `discount_max`,
MODIFY COLUMN `commission_rate_1`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '导购提成比例' AFTER `commission_rate`,
MODIFY COLUMN `commission_rate_2`  decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '副导购提成比例' AFTER `commission_rate_1`;
//2025-11-20
